<template>
    <a-trigger v-model="popoverVisible" :trigger="trigger" :position="position" :popup-translate="translate" show-arrow>
        <div class="flex">
			<i :class="['EachApp icon-hover', iconfont]" @click="popoverVisible = true"></i>
        </div>
        <template #content>
            <div class="trigger-style btn-list">
                <div class="item" v-for="item in btnList" :key="item.value" @click="emit('handleBtn', item)">
                    <a-button v-if="btnType === 'btn'">{{ item.label }}</a-button>
					<div class="text" v-if="btnType === 'text'">{{ item.label }}</div>
                </div>
                <slot name="content"></slot>
            </div>
        </template>
    </a-trigger>
</template>
<script lang="ts" setup>
import mixin from "@/mixins/index";
const { handleMixinPopover } = mixin();
const popoverVisible = ref(false)
defineProps({
	position:{ type: String, default: () => { return 'right' } }, // btn按钮  text文本
    btnList:{ type: Array, default: () => { return [] } },// 按钮列表
    translate:{ type: Array, default: () => { return [0, 5] } },// 按钮列表
    iconfont:{ type: String, default: () => { return 'EachApp_gengduo1' } },// 图标
	btnType:{ type: String, default: () => { return 'btn' } }, // btn按钮  text文本
    trigger:{ type: String, default: () => { return 'click' } }, // 图标 ['click', 'hover', 'focus']
});
const btnRef = ref();
const emit = defineEmits(['handleBtn']);
defineExpose({
	popoverVisible
})
</script>
